import React from 'react'
import { Modal, Button } from 'antd'
import { FlexCenterd } from '~/styles/commonstyle'
import { useNavigate } from 'react-router-dom'

const CertificateModal = ({ visible, onOk, onCancel }: any) => {
  const navigate = useNavigate()
  return (
    <Modal onCancel={onCancel} footer={null} visible={visible}>
      <FlexCenterd style={{ flexDirection: 'column' }}>
        <img style={{ width: '100%', height: 500 }} />
        <Button
          style={{ marginTop: 10, textAlign: 'center' }}
          onClick={() => {
            onOk()
            navigate(-1)
          }}
        >
          确认
        </Button>
      </FlexCenterd>
    </Modal>
  )
}

export default CertificateModal
